package com.wn.sms.controller;

import com.wn.common.result.Result;
import com.wn.sms.config.SmsTemplate;
import com.wn.sms.service.ISmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yellow Docter
 * @date 2023 -07-21
 * @desc
 */
@RestController
@RequestMapping("sms")
public class SmsController {

    @Autowired
    private ISmsService smsService;

    @GetMapping("/send/{phone}")
    public Result sendSms(@PathVariable("phone") String phone){
        //短信发送
        smsService.send(phone);

        return Result.ok("短信发送成功...");
    }

}
